package com.xian.zk.model;

import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * @program: zoo-task
 * @description:
 * @author: liru.xian
 * @create: 2022-01-16 11:50
 **/
@Data
@EqualsAndHashCode
public class Instance implements Serializable {
    /**
     * unique id of this instance.
     */
    private String instanceId;
    /**
     * path 序列化 ID
     */
    private String serializeId;

    /**
     * instance ip.
     */
    private String ip;

    /**
     * instance port.
     */
    private int port;

    /**
     * instance weight.
     */
    private double weight = 1.0D;

    /**
     * instance health status.
     */
    private boolean healthy = true;

    /**
     * If instance is enabled to accept request.
     */
    private boolean enabled = true;

    /**
     * If instance is ephemeral.
     *
     * @since 1.0.0
     */
    private boolean ephemeral = true;


    /**
     * Service information of instance.
     */
    private String serviceName;

    /**
     * user extended attributes.
     */
    private Map<String, String> metadata = new HashMap<String, String>();
}
